﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using CleverDD.Bll;
using CleverDD.Helper;
using CleverDD.Model.Communication.PLC;
using FrameWorkDemo.Communication.PLC;
using FrameWorkDemo.Communication.SerialPortFolder;
using HslCommunication;

namespace FrameWorkDemo
{
    public partial class AdminForm : Form
    {
        public AdminForm()
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterScreen;
        }


        private void EditPlcBtn_Click(object sender, EventArgs e)
        {
            EditPlcForm form = new EditPlcForm();
            form.ShowDialog();
        }

        private void ShowPlcBtn_Click(object sender, EventArgs e)
        {
            List<PlcAddressInfoEntity> plcAddressInfo = StaticTool.PlcAddressInfoList.Where(plcInfo => plcInfo.PlcInfoGuid == StaticTool.PlcInfoList[0].Guid).ToList();
            List<string> titleList = new List<string> { "PLC-1" };
            ShowDynPlcAddressForm form = new ShowDynPlcAddressForm(plcAddressInfo, titleList);
            form.ShowDialog();
        }

        private void AdminForm_Load(object sender, EventArgs e)
        {
        }

       

        private void EditSerialPortBtn_Click(object sender, EventArgs e)
        {
            EditSerialPortForm form = new EditSerialPortForm();
            form.ShowDialog();
        }
    }
}
